﻿@*
    For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
    Layout = null;
}


<!doctype html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>买不亏注册</title>
    <link rel="stylesheet" type="text/css" href="/css/styles.css">
    <link rel="stylesheet" href="/layui/css/layui.css">
    <script src="/layui/layui.js"></script>
    <style>
        .copyrights {
            text-indent: -9999px;
            height: 0;
            line-height: 0;
            font-size: 0;
            overflow: hidden;
        }
    </style>
</head>
<body>
    <div class="wrapper">

        <div class="container">
            <h1>Welcome</h1>
            <form class="layui-form form" action="">
                <div><a href="/login/login">进入登录页面</a></div>
                <input type="hidden" name="NickName" value="用户MBK57668" placeholder="电话">
                <input type="text" name="UserName" placeholder="登录名">
                @*<input type="hidden" name="Gender" placeholder="3">*@
                <div>
                    <input type="radio" name="Gender" value="1" title="男" checked>
                    <input type="radio" name="Gender" value="2" title="女">
                    <input type="radio" name="Gender" value="3" title="保密">
                </div>

                <input type="text" name="Phone" placeholder="电话">
                <input type="text" name="EMail" placeholder="邮箱">
                <input type="password" name="UserPwd" placeholder="密码">
                <div>
                    <input type="hidden" name="IsZhuXiao" value="False" title="未销户">
                </div>
                <button type="submit" id="login-button" lay-submit lay-filter="addForm">注册</button>
                <button type="reset" id="login-button">重置</button>

            </form>
        </div>

        <ul class="bg-bubbles">
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
        </ul>

    </div>
    <script>
        layui.use(["form", 'layer', 'laydate'], function() {
            var form = layui.form;
            var $ = layui.$;
            var layer = layui.layer;
            var laydate = layui.laydate;

            laydate.render({
                elem: '#ID-laydate-type-datetime1',
                type: 'datetime'
            });
            //提交
            form.on('submit(addForm)', function(data) {
                $.post("/login/Register", data.field, function(res) {
                    if (res.isSuccess) {
                        layer.msg(res.msg, function() {
                            window.location.href = "/login/login";
                        });
                    } else {
                        layer.msg(res.msg);
                    }
                });
                return false;
            });
        })
    </script>
</body>
</html>

